package 蓝桥杯;

import java.util.Scanner;

public class 薪水计算 {
    public static void main(String[] args) {
        Scanner S = new Scanner(System.in);
        double[] a = new double[3];
        a[0] = S.nextInt();
        a[1] = S.nextDouble();
        if(a[0] <= 40){
            a[2] = a[0] * a[1];
        }
        if(a[0] > 40 && a[0] <= 50){
            //80+30=110
            a[2] = 40 * a[1];
            a[2] += (a[0] - 40) * a[1] * 1.5 ;
//            a[2] = ((a[0]-(a[0]-40))*a[1])+ (a[0] - 40)*a[1]*1.5;
        }
        if(a[0] > 50){
            a[2] = 40 * a[1];
            a[2] += 10 * a[1] * 1.5;
            a[2] += (a[0] - 50) * a[1] * 2;
//            a[2] = (a[0] - 50)*a[1]*2 + ((a[0]-(a[0]-40))*a[1]*1.5) + ((a[0]-()*a[1]*1.5)  ;
        }
        System.out.printf("%.2f",a[2]);
    }
}
